package com.kakame.codenews.base.web.entity;

import java.util.Map;

public class Result {
	/** 返回的信息 */
	private String msg;

	/** 返回状态 */
	private String status;

	/** 返回的单个实体对象 */
	private Object object;

	/** 返回的一个map */
	private Map<String, Object> map;

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Object getObject() {
		return object;
	}

	public void setObject(Object object) {
		this.object = object;
	}

	public Map<String, Object> getMap() {
		return map;
	}

	public void setMap(Map<String, Object> map) {
		this.map = map;
	}

	public Result() {
	}
	
	public Result(Builder builder) {
		this.msg = builder.msg;
		this.object = builder.object;
		this.map = builder.map;
		this.status = builder.status;
	}

	public static Builder create() {
		return new Builder();
	}

	public static class Builder {

		private String msg;

		private String status;

		private Object object;

		private Map<String, Object> map;

		public Builder setMsg(String msg) {
			this.msg = msg;
			return this;
		}

		public Builder setStatus(String status) {
			this.status = status;
			return this;
		}

		public Builder setObject(Object object) {
			this.object = object;
			return this;
		}

		public Builder setMap(Map<String, Object> map) {
			this.map = map;
			return this;
		}

		public Result build() {
			return new Result(this);
		}
	}
}
